package com.kira.solo.schedule.receiver

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.util.Log
import com.kira.solo.schedule.ScheduleModuleEntryPoint
import dagger.hilt.android.EntryPointAccessors

/**
 * 定时器触发
 * @packageName com.kira.solo.schedule.receiver
 * @date 2024/1/26 9:45
 * @author zhanglei
 */
class AlarmReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context, intent: Intent) {
        intent.run {
            val id = extras?.getLong("taskId") ?: return
            val hiltEntryPoint =
                EntryPointAccessors.fromApplication(context, ScheduleModuleEntryPoint::class.java)
            hiltEntryPoint.caseExecutor().execute(id)
        }
    }
}